/*=============================================================================

  CAM MODULE INTERFACE

  FILE: HCAM.h
  
  DESCRIPTION

  EXTERNALIZED FUNCTIONS

    
  Copyright (c) DaeSung Engineering Inc. All rights reserved.

=============================================================================*/
/*=============================================================================

                             EDIT HISTORY

  ---------  -------  -------------------------------------------------------
    when          who        what, where, why
  ---------  -------  -------------------------------------------------------
   13/10/18     jyko       Initial version

=============================================================================*/

#ifndef _HCAM_H_
#define _HCAM_H_

/*=============================================================================
  HEADER INCLUSION
=============================================================================*/
#include <mxBase.h>
#include <devSP/hw_sony_cam.h>
#include "HCAM_cfg.h"

/*=============================================================================
  CONSTANT DEFINITION
=============================================================================*/
/*=============================================================================
  ENUMERATORS
=============================================================================*/
/*=============================================================================
  HOSC CLASS DEFINITION
=============================================================================*/
class HCAM : public HDev
{
public:
	HCAM();
	~HCAM();


//-------------------------------------------------------------------
// INITIALIZATION & TERMINATION
//-------------------------------------------------------------------
	virtual boolean Init(char *pszcfg);
	virtual boolean Close(void);
		
//-------------------------------------------------------------------
// STATUS MONITORING
//-------------------------------------------------------------------
	boolean IsDevInit(void);
	char *DevVersion(void);
	
//-----------------------------------------------
// CONFIGURATION
//-----------------------------------------------
	// WAIT-TIME
	boolean WaitTimeSet(int32 waitTime/*msec*/);
	boolean WaitTimeGet(int32 *waitTime/*msec*/);

	// ADVANCED
	boolean CFGEXset(CAM_CFGEX_s *cfg);
	boolean CFGEXget(CAM_CFGEX_s *cfg);

	// SAVE TO DEVICE
	boolean CFGSave(void);

//---------------------------------------------------------
// SETUP
//---------------------------------------------------------
	boolean GAINset(int32 gain/*0~18*/);
	boolean GAINget(int32 *gain);

	boolean SHUTTERset(int32 sht/*0~13*/);
	boolean SHUTTERget(int32 *sht);

	boolean WBset(int32 mod/*0~4*/);
	boolean WBget(int32 *mod);

	boolean RGAINset(int32 rgain/*0~255*/);
	boolean RGAINget(int32 *rgain);

	boolean BGAINset(int32 bgain/*0~255*/);
	boolean BGAINget(int32 *bgain);

	boolean WBWset(int32 enable/*0~1*/);
	boolean WBWget(int32 *enable);

	boolean SHARPset(int32 shp/*0~7*/);
	boolean SHARPget(int32 *shp);

	boolean GAMset(int32 mod/*0~3*/);
	boolean GAMget(int32 *mod);

	boolean BINset(int32 val/*0~1024*/);
	boolean BINget(int32 *val);

	boolean COLBARset(int32 enable/*0~1*/);
	boolean COLBARget(int32 *enable);

//---------------------------------------------------------
// TRIGGER MODE
//---------------------------------------------------------
	boolean TRIGset(byte mode/*CAM_TRIGGER*/);
	boolean TRIGget(byte *mode);

//---------------------------------------------------------
// ERROR HANDLING
//---------------------------------------------------------
	int32 ERRget(void);
	char *ERRstring(int32 err_code);

protected:
	cam_cfg_s			*m_pCFG;

	boolean INIT_LIB(char *pszName);
	boolean CLOSE_LIB(void);

//---------------------------------------------------------
// EVENT HANDLER
//---------------------------------------------------------
public:
	virtual dword Event_Handler(dword dwEvent, dword wParam, dword lParam);
protected:
	virtual dword Event_PreProc(dword dwEvent, dword wParam, dword lParam);
};
#endif /* _HCAM_H_ */

/*--- END OF HCAM.h ---*/
